set(TARGET_NAME WaveSimulator)

find_package(QT COMPONENTS Core REQUIRED)
find_package(Qt6 COMPONENTS Widgets Charts REQUIRED)
find_package(QCustomUi REQUIRED)

set(CMAKE_AUTOMOC ON)
set(CMAKE_AUTOUIC ON)
set(CMAKE_AUTORCC ON)

file(GLOB HEADERS "*.h")
file(GLOB SOURCES "*.cpp")
file(GLOB UI "*.ui")
file(GLOB RESOURCES "*.qrc")

source_group("Headers" FILES ${HEADERS})
source_group("Sources" FILES ${SOURCES})
source_group("UI" FILES ${UI})
source_group("Resources" FILES ${RESOURCES})

add_executable(${TARGET_NAME} WIN32 ${HEADERS} ${SOURCES} ${UI} ${RESOURCES})
set_property(TARGET ${TARGET_NAME} PROPERTY FOLDER "Examples")
target_link_libraries(${TARGET_NAME} PRIVATE Qt::Widgets Qt::Charts QCustomUi)

install(IMPORTED_RUNTIME_ARTIFACTS QCustomUi DESTINATION ${INSTALL_BINDIR}/${CMAKE_BUILD_TYPE})
install(TARGETS ${TARGET_NAME} RUNTIME DESTINATION ${INSTALL_BINDIR}/${CMAKE_BUILD_TYPE})